namespace Leey.Net.eTerm
{
    using System;
    using System.Diagnostics;

    internal class LogWirter
    {
        private EventLogEntryType eventLogType = EventLogEntryType.Error;
        private string eventSourceName = "test";

        public void LogEvent(string message)
        {
            if (!EventLog.SourceExists(this.eventSourceName))
            {
                EventLog.CreateEventSource(this.eventSourceName, "Application");
            }
            EventLog.WriteEntry(this.eventSourceName, message, EventLogEntryType.Error);
        }

        public EventLogEntryType EventLogType
        {
            set
            {
                this.eventLogType = value;
            }
        }

        public string EventSourceName
        {
            set
            {
                this.eventSourceName = value;
            }
        }
    }
}
